﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SugarWebApi
{
	public class SugarField : SugarObject
	{

		#region Constructors

		public SugarField(
			SugarWebConext context) :
			base(context)
		{

		}

		#endregion

		#region Properties


		public string DefaultValue
		{
			get;
			protected internal set;
		}

		public string Label
		{
			get;
			protected internal set;
		}

		public string Name
		{
			get;
			protected internal set;
		}

		public bool Required
		{
			get;
			protected internal set;
		}

		public string Type
		{
			get;
			protected internal set;
		}

		#endregion

		public static string[] ToStringArray(
			SugarField[] fields)
		{
			string[] values = new string[fields.Length];
			for (int i = 0; i < values.Length; ++i)
			{
				values[i] = fields[i].Name;
			}
			return values;
		}

	}
}
